Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update locustfile.py #13047

Closed
wants to merge 1 commit into from
Closed

Conversation

mst-rajatmishra
Copy link

@mst-rajatmishra mst-rajatmishra commented Sep 30, 2024

Hello,
i tried making some changes in the code like,
Added try-except blocks around the requests to log any errors.
Changed tag-min-score and face-min-score to float to accept decimal values.
Hope this helps,
Thank you,
RAJAT MISHRA

@bo0tzz
Copy link
Member

bo0tzz commented Sep 30, 2024

PRs can be reopened, so please don't unnecessarily create new ones. Feel free to ask for help if you can't figure out how to get an existing PR into shape.

Can you explain the reasoning for why you made these changes?

@mst-rajatmishra
Copy link
Author

Can you explain the reasoning for why you made these changes?

Hello, here are some basic changes i tried making,

  1. Handling Error
    We added error handling to catch any issues when making HTTP requests. This way, if something goes wrong, like the server being down, we get a clear message instead of just failing silently. It helps us troubleshoot and understand what’s happening during tests.

  2. Parameter Types
    We changed the score parameters from integers to floats. Scores can be decimal values, so this change allows users to set more precise scores like 0.5 instead of just whole numbers, making the script more flexible.

  3. Improved Documentation
    We included comments throughout the code to explain what different parts do. This makes it easier for anyone reading the code, w0hether it's you later or someone else, to understand how to use it and why things are set up a certain way.

  4. Consistency and Clarity
    We focused on keeping the coding style consistent. This includes using similar naming conventions and formatting throughout the code, which makes it easier to read and maintain.

  5. Dynamic Feedback on Errors
    We set up a system to provide immediate feedback if a request fails. By logging errors globally, we can quickly see what went wrong, making it easier to track down issues during testing.

Thank you,
RAJAT MISHRA.

Copy link
Contributor

@mertalev mertalev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Thanks for the PR, but the try/catches here are unnecessary since Locust already handles errors.

@mertalev mertalev closed this Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants